{% extends 'layout.html' %}
{% block content %}
<div class="card-body">
  <div style="display: flex; justify-content: space-between">
    <p style="font-family: 华文仿宋; font-size: 15px; font-weight: 600">
      部门信息
    </p>
    <a href="/depart/add/"
      ><button
        type="button"
        class="btn btn-primary"
        style="
          margin-top: -5px;
          width: 100px;
          height: 35px;
          font-size: 14px;
          line-height: 22px;
          font-family: 华文宋体;
        "
      >
        新建部门
      </button></a
    >
  </div>
  <div class="infoList" style="font-size: 14px; font-family: 'Tw Cen MT', 华文宋体">
    <table class="table table-striped table-hover">
      <thead>
        <tr>
          <th scope="col">ID</th>
          <th scope="col">部门名称</th>
          <th scope="col">操作</th>
        </tr>
      </thead>
      <tbody style="font-weight: 600; font-size: 14px">
        {% for obj in queryset %}
        <tr>
          <th scope="row" style="line-height: 30px">{{ obj.id }}</th>
          <td style="line-height: 30px">{{ obj.title }}</td>
          <td>
            <a href="/depart/{{ obj.id }}/update/">
              <button
                type="button"
                class="btn btn-secondary"
                style="font-size: 10px"
              >
                编辑
              </button>
            </a>
            <a href="/depart/delete/?id={{ obj.id }}">
              <button
                type="button"
                class="btn btn-danger"
                style="font-size: 10px"
              >
                删除
              </button>
            </a>
          </td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
  </div>
</div>
{% endblock %}
